#include <iostream>
using namespace std;


#if 0
class A
{
    public:
    	A(void)
    	{
    		cout << "A的无参构造" << endl;
    		m_i = 0;
		}
    public:
    	int m_i;
};

class B
{
    public:
    	int m_j; //基本类型成员变量
    	A m_a; //类类型成员变量（成员子对象）
};
    

int main()
{
    B b; //调用成员对象m_a的无参构造函数 调用B的缺省构造函数
    cout << b.m_j << endl; //未知
    cout << b.m_a.m_i <<endl; //0
    return 0;
}

#endif

struct param
{
    int l;
    int w;
    int h;
    int ww;
};

class Desk
{
    
private:
    int length, width, height, weight;

public:
    Desk(int l, int w, int h, int ww);

#if 1
    Desk(void){
    cout << "Desk(void)" << endl;
    length = 0;
    width = 0;
    height = 0;
    weight = 0;
}
#endif

Desk(param & p){
    cout << "Desk(parm &)" << endl;
    length = p.l;
    width = p.w;
    height = p.h;
    weight = p.ww;
}
};

#if 1
Desk::Desk(int l, int w, int h, int ww)
{
    cout << "Desk(int, int, int, int)" <<endl;
    length = l;
    width = w;
    height = h;
    weight = ww;
}
#endif


int main(void)
{
    Desk d1(1,2,3,4);
    Desk d2; //调用无参构造函数
    param pm;
    pm.l = 1;
    pm.w = 2;
    pm.h = 3;
    pm.ww =4;

    Desk d3(pm);
    return 0;
}